<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateLogAgentWithdrawalFlowsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('log_agent_withdrawal_flows', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('agent_id')->comment('代理id');
			$table->string('pay_type', 64)->nullable()->comment('提款到账方式');
			$table->string('transferid', 64)->comment('交易号');
			$table->string('account', 64)->nullable()->comment('提款到账账号');
			$table->string('account_address', 128)->nullable()->comment('开户地址（银行卡必须）');
			$table->string('account_real_name', 64)->nullable()->comment('开户真实名');
			$table->decimal('before_account_money', 15, 3)->default(0.000)->comment('申请前账户余额');
			$table->decimal('money', 15, 3)->default(0.000)->comment('申请金额');
			$table->decimal('procedure_fee', 15, 3)->default(0.000)->comment('手续费');
			$table->decimal('to_account_money', 15, 3)->default(0.000)->comment('到账金额');
			$table->decimal('after_account_money', 15, 3)->default(0.000)->comment('审核后账户余额');
			$table->integer('audit_account_id')->nullable()->comment('审核账号id');
			$table->dateTime('audit_at')->nullable()->comment('审核时间');
			$table->integer('status')->default(0)->comment('启用状态 -1：注销申请；0:申请中；1：审核通过');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('log_agent_withdrawal_flows');
	}

}
